//
//  TYZStarView.h
//  DriveSchoolCoach
//
//  Created by TangBin on 2019/8/29.
//  Copyright © 2019 TangBin. All rights reserved.
//

#import "TYZBaseView.h"

NS_ASSUME_NONNULL_BEGIN

@protocol TYZStarViewDelegate <NSObject>

@optional
- (void)didTouchStarViewScore:(CGFloat)score index:(NSInteger)index;

@end

#define kkEDSStarViewNum (5)

#define kEDSStarReadViewSpace (6)
#define kEDSStarReadViewWidth (18 * kkEDSStarViewNum + kEDSStarReadViewSpace * (kkEDSStarViewNum - 1))
#define kEDSStarReadViewHeight (18)

@interface TYZStarView : TYZBaseView

@property (nonatomic, assign) CGFloat totalScore; ///< 评分总值，默认是1.0
@property (nonatomic, assign) CGFloat currentScore; ///< 当前分数，默认是0.0
@property (nonatomic, assign) BOOL isFullStarLimited; ///< 是否限制只能有整星，默认YES 有。
@property (nonatomic, weak) id<TYZStarViewDelegate> delegate;
@property (nonatomic, copy) void(^touchStarViewScoreBlock)(CGFloat score, NSInteger index);


/**
 初始化

 @param frame frame description
 @param numberOfStars 五角星个数，如果是0默认5个
 @param touchable 是否允许点击
 @return return value description
 */
- (instancetype)initWithFrame:(CGRect)frame numberOfStars:(NSInteger)numberOfStars touchable:(BOOL)touchable;

@end

NS_ASSUME_NONNULL_END



























